<template>
  <a-table v-bind="$attrs" :scroll="scroll">
    <template v-slot:[item]="scope" v-for="item in slotsKeys">
      <slot :name="item" v-bind="scope || {}"></slot>
    </template>
  </a-table>
</template>
<script setup>
import { useSlots, computed } from 'vue'
import { useElementSize, useParentElement } from '@vueuse/core'
/**
 * 插槽
 */
let slots = useSlots()
let slotsKeys = Object.keys(slots)
/**
 * 容器大小
 */
let parentEl = useParentElement()
let { width, height } = useElementSize(parentEl)
let scroll = computed(() => {
  return { x: width.value - 20, y: height.value - 120 }
})
</script>
